package com.zhiyou100.day04;

public class FuZhiDemo {
    public static void main(String[] args) {
        // 赋值运算符 = += -= *= /= %=
        int a = 1;
        /*a += 1;
        a *= 2;
        a /= 2;
        System.out.println(a);*/

        /*
         * a++ 和 ++a都是自增1
         * a++是先运算再自增
         * ++a是先自增再运算
         *
         * a-- --a同理
         */
        System.out.println("a=" + a);

        int b = a++;    // b=a; a=a+1;
        a = 1;
        int c = ++a;    // a=a+1; c=a;
        System.out.println("b=" + b);
        System.out.println("c=" + c);

        a = 1;
        b = a--;    // b=a; a=a-1;
        System.out.println("b=" + b);
        a = 1;
        c = --a;    // a=a-1; c=a;
        System.out.println("c=" + c);
    }
}
